package com.star.message.biz;

import com.star.common.core.contract.Page;
import com.star.common.sms.contract.query.SendDetailPageQuery;
import com.star.common.sms.contract.query.SendStatisticsPageQuery;
import com.star.common.sms.contract.vo.SendDetailPageVO;
import com.star.common.sms.contract.vo.SendStatisticsPageVO;
import com.star.common.sms.factory.SmsFactory;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 短信统计服务
 *
 * @author zhouhengzhe
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class SmsStaticsBizService {

    private final SmsFactory smsFactory;

    /**
     * 分页查询短信发送记录和发送状态等信息
     *
     * @param query 查询参数
     * @return 短信发送量详情
     */
    public Page<SendDetailPageVO> pageSendDetail(SendDetailPageQuery query) {
        return smsFactory.getAliyunSmsClient().pageSendDetail(query);
    }

    /**
     * 查询短信发送量详情
     *
     * @param query 查询参数
     * @return 短信发送量详情
     */
    public Page<SendStatisticsPageVO> pageSendStatistics(SendStatisticsPageQuery query) {
        return smsFactory.getAliyunSmsClient().pageSendStatistics(query);
    }
}
